package com.lsc.blog.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lsc.blog.pojo.User;
import com.lsc.blog.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  测试
 * </p>
 *
 * @author 上河图
 * @since 2020-10-06
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserServiceImpl userService;

    @RequestMapping("/get")
    public User getUserById(){
       return userService.getId(3);
    }

    @RequestMapping("/getOne")
    public User getOne(){

        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("name","Jack");
        return userService.getOne(wrapper);

    }

}
